import request from '@/utils/request'

export function getRoleList(params) {
  return request({
    url: '/admin/auth/role',
    method: 'get',
    params
  })
}

export function addOneRole(data) {
  return request({
    url: '/admin/auth/role',
    method: 'post',
    data
  })
}

export function updateOneRole(data) {
  return request({
    url: '/admin/auth/role',
    method: 'put',
    data
  })
}

export function getRoleByID(idObj) {
  const { id } = idObj
  return request({
    url: `/admin/auth/role/${id}`,
    method: 'get'
  })
}

export function deleteOneRole(idObj) {
  const { id } = idObj
  return request({
    url: `/admin/auth/role/${id}`,
    method: 'delete'
  })
}
